package org.bagou.proj.main

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.alibaba.android.arouter.launcher.ARouter
import dagger.hilt.android.AndroidEntryPoint
import kotlinx.android.synthetic.main.activity_main.*
import javax.inject.Inject

@AndroidEntryPoint
class MainActivity : AppCompatActivity() {

    @set:Inject
    internal var iLogService:ILogService?=null
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)


//        image.setImageDrawable(resources.getDrawable(R.mipmap.ic_launcher,null))
        iLogService?.login()


//        val img = ImageView(this)
//        img.layoutParams = ViewGroup.LayoutParams(300, 400)
        //设置bitmap
//        var bitmap: Bitmap = BitmapFactory.decodeResource(resources, R.mipmap.launch_splash_center)
////        img.setImageBitmap(bitmap)
//        image.setImageBitmap(bitmap)
//
//        image.setOnClickListener {
//            Toast.makeText(this,"imgClick",Toast.LENGTH_LONG).show()
//            ARouter.getInstance().build("/common/start/CommonActivity").navigation()
//        }



        btnCommon.setOnClickListener {
            ARouter.getInstance().build("/common/start/CommonActivity").navigation()
        }

        btnNewMvvm.setOnClickListener {
            ARouter.getInstance().build("/new/activity/NewMvvmActivity").navigation()
        }
        btnNewDatabindingMvvm.setOnClickListener {
            ARouter.getInstance().build("/new/activity/NewDatabindingMvvmActivity").navigation()
        }

        btnOldMvvm.setOnClickListener {
            ARouter.getInstance().build("/old/activity/OldMvvmActivity").navigation()
        }

        btnMvp.setOnClickListener {
            ARouter.getInstance().build("/mvp/activity/MainMvpActivity").navigation()
        }

    }
}
